export default {
	server: {
		port: 8080, // default: 3000
		host: '0.0.0.0', // default: localhost,
	},
	router: {
		extendRoutes(routes, resolve) {
			// 删除数组里的所有数据，不能用赋值清空
			routes.splice(0)
			routes.push(...[
				{
					path: '/',
					component: resolve(__dirname, 'pages/layouts/default.vue'),
					children: [
						{
							name: 'home',
							path: '',
							component: resolve(__dirname, 'pages/home')
						},
					]
				},
				{
					name: 'notFind',
					path: '*',
					component: resolve(__dirname, 'pages/exception/404.vue')
				}
			])
		}
	},
	// Global page headers: https://go.nuxtjs.dev/config-head
	head: {
		title: 'countryside',
		htmlAttrs: {
			lang: 'en'
		},
		meta: [
			{ charset: 'utf-8' },
			{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
			{ hid: 'description', name: 'description', content: '' }
		],
		link: [
			{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
		]
	},

	// Global CSS: https://go.nuxtjs.dev/config-css
	css: [
		'vant/lib/index.css'
	],

	// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
	plugins: [
		'@/plugins/vant',
        '~/plugins/axios'
	],

	// Auto import components: https://go.nuxtjs.dev/config-components
	components: true,

	// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
	buildModules: [
	],

	// Modules: https://go.nuxtjs.dev/config-modules
	modules: [
		// https://go.nuxtjs.dev/axios
		'@nuxtjs/axios',
	],

	// Axios module configuration: https://go.nuxtjs.dev/config-axios
	axios: {
		proxy: true
	},

	proxy: {
		'/side/': { target: 'http://localhost:3000', pathRewrite: { '^/side/': '' } }
	},

	// Build Configuration: https://go.nuxtjs.dev/config-build
	build: {
        babel: {
            plugins: [
                ["@babel/plugin-proposal-private-methods", { "loose": true }]
            ]
        }
	}
}
